import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * This class represents the new button order to start from a new canvas.
 * 
 * @author Christian Pérez Zavalija
 * @version 25-Jun-2013
 */
public class BtnNew extends Button
{
    private GreenfootImage[] buttons;
    
    /**
     * Constructor for objects of class Boton. Load the images in an array and displays
     */
    public BtnNew()
    {  
        buttons=new GreenfootImage[2];
        for(int i=0;i<2;i++)
            buttons[i]=new GreenfootImage("button"+i+".png");
        setImage(buttons[0]);
    }
    
    /**
     * button image changes to make click.
     */
    public void act()
    {
        if(Greenfoot.mousePressed(this)){
            setImage(buttons[1]);
            Greenfoot.delay(8);
        }
        setImage(buttons[0]);
    }
}
